package za.ac.cput.peterjohn.DesignPatternPrincipals.Behavioral.Command.Factory;

import za.ac.cput.peterjohn.DesignPatternPrincipals.Behavioral.Command.Model.Command;
import za.ac.cput.peterjohn.DesignPatternPrincipals.Behavioral.Command.Model.Dinner;
import za.ac.cput.peterjohn.DesignPatternPrincipals.Behavioral.Command.Model.DinnerCommand;
import za.ac.cput.peterjohn.DesignPatternPrincipals.Behavioral.Command.Model.Lunch;


public class CommandFactory 
{
    private static Command command1;
    private static Command command2;

    public static Command createLunchCommand(Lunch lunch) 
    {
        if(command1 == null)
            command1 = new LunchCommand(lunch);
        return command1;
    }

    public static Command createDinnerCommand(Dinner dinner) 
    {
        if(command2 == null)
            command2 = new DinnerCommand(dinner);
        return command2;
    }
}